import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysErrorLog = (params) => {
  params.head.transCode = 'querySysErrorLog';
  return request({
    url: '/platform/sysErrorLog/querySysErrorLog',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysErrorLogListPage = (params) => {
  params.head.transCode = 'querySysErrorLogListPage';
  return request({
    url: '/platform/sysErrorLog/querySysErrorLogListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysErrorLog = (params) => {
  params.head.transCode = 'saveSysErrorLog';
  return request({
    url: '/platform/sysErrorLog/saveSysErrorLog',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysErrorLogList = (params) => {
  params.head.transCode = 'saveSysErrorLogList';
  return request({
    url: '/platform/sysErrorLog/saveSysErrorLogList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysErrorLog = (params) => {
  params.head.transCode = 'saveOrUpdateSysErrorLog';
  return request({
    url: '/platform/sysErrorLog/saveOrUpdateSysErrorLog',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysErrorLogList = (params) => {
  params.head.transCode = 'saveOrUpdateSysErrorLogList';
  return request({
    url: '/platform/sysErrorLog/saveOrUpdateSysErrorLogList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysErrorLog = (params) => {
  params.head.transCode = 'updateSysErrorLog';
  return request({
    url: '/platform/sysErrorLog/updateSysErrorLog',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysErrorLog = (params) => {
  params.head.transCode = 'deleteSysErrorLog';
  return request({
    url: '/platform/sysErrorLog/deleteSysErrorLog',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysErrorLogList = (params) => {
  params.head.transCode = 'deleteSysErrorLogList';
  return request({
    url: '/platform/sysErrorLog/deleteSysErrorLogList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysErrorLogExcel = (params) => {
  downloadExcel({
    url: '/platform/sysErrorLog/excelDownload/exportSysErrorLogExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
